/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.example;

import java.util.ArrayList;
import java.util.List;

import chunmap.app.MapCtrl;
import chunmap.data.provider.LayerFactory;
import chunmap.model.geom.Geometry;
import chunmap.view.layer.VectorLayer;

/**
 * @author chunquedong
 * 
 */
public abstract class BaseGeometryMap extends BaseMap{

	/**
	 * 模板方法
	 * @param geoms
	 */
	protected abstract void addGeometry(List<Geometry> geoms);

	@Override
	protected void addLayer(MapCtrl map) {
		List<Geometry> geoms = new ArrayList<Geometry>();
		addGeometry(geoms);

		VectorLayer layer = LayerFactory.createGeometryLayer(geoms);
		map.getLayerCollection().add(layer);
	}
}